Coin Problem
   HOME

TheInfoList



OR:

The coin problem (also referred to as the Frobenius coin problem or Frobenius problem, after the mathematician Ferdinand Frobenius) is a
mathematical Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
problem that asks for the largest monetary amount that cannot be obtained using only coins of specified denominations, for example, the largest amount that cannot be obtained using only coins of 3 and 5 units is 7 units. The solution to this problem for a given set of coin denominations is called the Frobenius number of the set. The Frobenius number exists as long as the set of coin denominations has no
common divisor In mathematics, the greatest common divisor (GCD) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For two integers ''x'', ''y'', the greatest common divisor of ''x'' and ''y'' is ...
greater than 1. There is an explicit formula for the Frobenius number when there are only two different coin denominations, ''x'' and ''y'': the Frobenius number is then ''xy'' − ''x'' − ''y''. If the number of coin denominations is three or more, no explicit formula is known. However, for any fixed number of coin denominations, there is an
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
computing the Frobenius number in polynomial time (in the logarithms of the coin denominations forming an input). No known algorithm is polynomial time in the ''number'' of coin denominations, and the general problem, where the number of coin denominations may be as large as desired, is NP-hard.


Statement

In mathematical terms the problem can be stated: :Given positive
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
s ''a''1, ''a''2, ..., ''a''''n'' such that gcd(''a''1, ''a''2, ..., ''a''''n'') = 1, find the largest integer that ''cannot'' be expressed as an integer
conical combination Given a finite number of vectors x_1, x_2, \dots, x_n in a real vector space, a conical combination, conical sum, or weighted sum''Convex Analysis and Minimization Algorithms'' by Jean-Baptiste Hiriart-Urruty, Claude Lemaréchal, 1993, pp. 101, 102/ ...
of these numbers, i.e., as a sum :: ''k''1''a''1 + ''k''2''a''2 + ··· + ''k''''n''''a''''n'', :where ''k''1, ''k''2, ..., ''k''''n'' are non-negative integers. This largest integer is called the Frobenius number of the set , and is usually denoted by ''g''(''a''1, ''a''2, ..., ''a''''n''). The requirement that the greatest common divisor (GCD) equal 1 is necessary in order for the Frobenius number to exist. If the GCD were not 1, then starting at some number ''m'' the only sums possible are multiples of the GCD; every number past ''m'' that is not divisible by the GCD cannot be represented by any linear combination of numbers from the set. For example, if you had two types of coins valued at 6 cents and 14 cents, the GCD would equal 2, and there would be no way to combine any number of such coins to produce a sum which was an odd number; additionally,
even numbers In mathematics, parity is the property of an integer of whether it is even or odd. An integer is even if it is a multiple of two, and odd if it is not.. For example, −4, 0, 82 are even because \begin -2 \cdot 2 &= -4 \\ 0 \cdot 2 &= 0 \\ ...
2, 4, 8, 10, 16 and 22 (less than ''m=24'') could not be formed, either. On the other hand, whenever the GCD equals 1, the set of integers that cannot be expressed as a conical combination of is bounded according to
Schur's theorem In discrete mathematics, Schur's theorem is any of several theorems of the mathematician Issai Schur. In differential geometry, Schur's theorem is a theorem of Axel Schur. In functional analysis, Schur's theorem is often called Schur's property ...
, and therefore the Frobenius number exists.


Frobenius numbers for small ''n''

A closed-form solution exists for the coin problem only where ''n'' = 1 or 2. No closed-form solution is known for ''n'' > 2.


''n'' = 1

If ''n'' = 1, then ''a''1 = 1 so that all natural numbers can be formed.


''n'' = 2

If ''n'' = 2, the Frobenius number can be found from the formula g(a_1, a_2) = a_1a_2-a_1-a_2. This formula was discovered by James Joseph Sylvester in 1882, although the original source is sometimes incorrectly cited as, in which the author put his theorem as a recreational problem (and did not explicitly state the formula for the Frobenius number). Sylvester also demonstrated for this case that there are a total of N(a_1, a_2) = (a_1-1)(a_2-1)/2 non-representable (positive) integers. Another form of the equation for g(a_1, a_2) is given by Skupień in this proposition: If a_1,a_2 \in \mathbb and \gcd(a_1, a_2) = 1 then, for each n \ge (a_1-1)(a_2-1), there is exactly one pair of nonnegative integers \rho and \sigma such that \sigma < a_1 and n = \rho a_1 +\sigma a_2. The formula is proved as follows. Suppose we wish to construct the number m \ge (a_1-1)(a_2-1). Since \gcd(a_1, a_2) = 1, all of the integers m - j a_2 for j=0,1,\ldots,a_1-1 are mutually distinct modulo a_1. Hence there is a unique value of j, say j=\sigma, and a nonnegative integer \rho, such that m = \rho a_1 +\sigma a_2: Indeed, \rho\ge 0 because \rho a_1 = m - \sigma a_2 \ge (a_1-1)(a_2-1) - (a_1 -1)a_2 = -a_1 + 1.


''n'' = 3

Formulae and fast algorithms are known for three numbers though the calculations can be very tedious if done by hand. Simpler lower and upper bounds for Frobenius numbers for ''n'' = 3 have been also determined. The asymptotic lower bound due to Davison :f(a_1, a_2, a_3) \equiv g(a_1, a_2, a_3) + a_1 + a_2 + a_3 \geq \sqrt is relatively sharp. (f here is the ''modified Frobenius number'' which is the greatest integer not representable by ''positive'' integer linear combinations of a_1, a_2, a_3.) Comparison with the actual limit (defined by the parametric relationship, f(z(i)) = 9i^2 + 54i + 79 where z(i) = a_1 a_2 a_3 = (3i + 7)(3i + 10)(3i^2 + 19i + 29)) shows that the approximation is only 1 less than the true value as i \rightarrow \infty. It is conjectured that a similar parametric upper bound (for values of a_1, a_2, a_3 that are pairwise-coprime and no element is representable by the others) is f(z(i)) = 6i^2 + 19i + 13 where z(i) = a_1 a_2 a_3 = (3i + 2)(3i + 3)(6i + 7). The asymptotic average behaviour of f for three variables is also known: :f(a_1, a_2, a_3) \sim \frac8\sqrt,


Frobenius numbers for special sets


Arithmetic sequences

A simple formula exists for the Frobenius number of a set of integers in an
arithmetic sequence An arithmetic progression or arithmetic sequence () is a sequence of numbers such that the difference between the consecutive terms is constant. For instance, the sequence 5, 7, 9, 11, 13, 15, . . . is an arithmetic progression with a common differ ...
. Given integers ''a'', ''d'', ''w'' with gcd(''a'', ''d'') = 1: : g(a,a+d,a+2d,\dots,a+wd)=\left(\left\lfloor\frac\right\rfloor\right)a+d(a-1) The n=2 case above may be expressed as a special case of this formula. In the event that a > w^2-3w+1 , we can omit any subset of the elements a+2d, a+3d, ..., a+(w-3)d, a+(w-2)d from our arithmetic sequence and the formula for the Frobenius number remains the same.


Geometric sequences

There also exists a closed form solution for the Frobenius number of a set in a
geometric sequence In mathematics, a geometric progression, also known as a geometric sequence, is a sequence of non-zero numbers where each term after the first is found by multiplying the previous one by a fixed, non-zero number called the ''common ratio''. For e ...
. Given integers ''m'', ''n'', ''k'' with gcd(''m'', ''n'') = 1: : g(m^k,m^n,m^n^2,\dots,n^k)=n^(mn-m-n)+\frac. : A simpler formula that also displays symmetry between the variables is as follows. Given positive integers a,b,k, with \gcd(a,b)=1, let A_k(a,b) = \. Then : g(A_k(a,b))=_(a,b) - _k(a,b) - (a^ + b^), : where _k(a,b) denotes the sum of all integers in A_k(a,b).


Examples


McNugget numbers

One special case of the coin problem is sometimes also referred to as the McNugget numbers. The McNuggets version of the coin problem was introduced by Henri Picciotto, who included it in his algebra textbook co-authored with Anita Wah. Picciotto thought of the application in the 1980s while dining with his son at McDonald's, working the problem out on a napkin. A McNugget number is the total number of
McDonald's McDonald's Corporation is an American multinational fast food chain, founded in 1940 as a restaurant operated by Richard and Maurice McDonald, in San Bernardino, California, United States. They rechristened their business as a hambur ...
Chicken McNuggets Chicken McNuggets are a type of chicken nuggets sold by the international fast food restaurant chain McDonald's. They consist of small pieces of reconstituted boneless chicken meat that have been battered and deep fried. Chicken McNuggets w ...
in any number of boxes. In the
United Kingdom The United Kingdom of Great Britain and Northern Ireland, commonly known as the United Kingdom (UK) or Britain, is a country in Europe, off the north-western coast of the European mainland, continental mainland. It comprises England, Scotlan ...
, the original boxes (prior to the introduction of the
Happy Meal A Happy Meal is a kids' meal usually sold at the American fast food restaurant chain McDonald's since June 1979. A small toy or book is included with the food, both of which are usually contained in a red cardboard box with a yellow smiley fac ...
-sized nugget boxes) were of 6, 9, and 20 nuggets. According to
Schur's theorem In discrete mathematics, Schur's theorem is any of several theorems of the mathematician Issai Schur. In differential geometry, Schur's theorem is a theorem of Axel Schur. In functional analysis, Schur's theorem is often called Schur's property ...
, since 6, 9, and 20 are (setwise)
relatively prime In mathematics, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equivale ...
, any sufficiently large integer can be expressed as a (non-negative, integer) linear combination of these three. Therefore, there exists a largest non-McNugget number, and all integers larger than it are McNugget numbers. Namely, every positive integer is a McNugget number, with the finite number of exceptions: : 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 22, 23, 25, 28, 31, 34, 37, and 43 . Thus the largest non-McNugget number is 43. The fact that any integer larger than 43 is a McNugget number can be seen by considering the following
integer partition In number theory and combinatorics, a partition of a positive integer , also called an integer partition, is a way of writing as a sum of positive integers. Two sums that differ only in the order of their summands are considered the same part ...
s :44 = 6 + 9 + 9 + 20 :45 = 9 + 9 + 9 + 9 + 9 :46 = 6 + 20 + 20 :47 = 9 + 9 + 9 + 20 :48 = 6 + 6 + 9 + 9 + 9 + 9 :49 = 9 + 20 + 20 Any larger integer can be obtained by adding some number of 6s to the appropriate partition above. Alternatively, since \textrm(9, 20) = 180 and 6, 180, the solution can also be obtained by applying a formula presented for n=3 earlier: :g(6, 9, 20) = \textrm(6, 9) + \textrm(6, 20) -6 -9 -20 = 18 + 60 -35 = 43 Furthermore, a straightforward check demonstrates that 43 McNuggets can indeed ''not'' be purchased, as: # boxes of 6 and 9 alone cannot form 43 as these can only create multiples of 3 (with the exception of 3 itself); # including a single box of 20 does not help, as the required remainder (23) is also not a multiple of 3; and # more than one box of 20, complemented with boxes of size 6 or larger, obviously cannot lead to a total of 43 McNuggets. Since the introduction of the 4-piece Happy Meal-sized nugget boxes, the largest non-McNugget number is 11. In countries where the 9-piece size is replaced with the 10-piece size, there is no largest non-McNugget number, as any odd number cannot be made.


Other examples

In
rugby union Rugby union, commonly known simply as rugby, is a close-contact team sport that originated at Rugby School in the first half of the 19th century. One of the two codes of rugby football, it is based on running with the ball in hand. In it ...
, there are four types of scores: penalty goal (3 points), drop goal (3 points), try (5 points) and converted try (7 points). By combining these any points total is possible except 1, 2, or 4. In rugby sevens, although all four types of scores are permitted, attempts at penalty goals are rare and drop goals almost unknown. This means that team scores almost always consist of multiples of try (5 points) and converted try (7 points). The following scores (in addition to 1, 2, and 4) cannot be made from multiples of 5 and 7 and so are almost never seen in sevens: 3, 6, 8, 9, 11, 13, 16, 18 and 23. By way of example, none of these scores was recorded in any game in the 2014-15 Sevens World Series. Similarly, in
American football American football (referred to simply as football in the United States and Canada), also known as gridiron, is a team sport played by two teams of eleven players on a rectangular field with goalposts at each end. The offense, the team wi ...
, the only way for a team to score exactly one point is if a
safety Safety is the state of being "safe", the condition of being protected from harm or other danger. Safety can also refer to the control of recognized hazards in order to achieve an acceptable level of risk. Meanings There are two slightly dif ...
is awarded against the opposing team when they attempt to
convert Conversion or convert may refer to: Arts, entertainment, and media * "Conversion" (''Doctor Who'' audio), an episode of the audio drama ''Cyberman'' * "Conversion" (''Stargate Atlantis''), an episode of the television series * "The Conversion" ...
after a touchdown. As 2 points are awarded for safeties from regular play, and 3 points are awarded for field goals, all scores other than 1–0, 1–1, 2–1, 3–1, 4–1, 5–1 and 7–1 are possible.


Applications


Shellsort Time Complexity

The
Shellsort Shellsort, also known as Shell sort or Shell's method, is an in-place comparison sort. It can be seen as either a generalization of sorting by exchange (bubble sort) or sorting by insertion ( insertion sort). The method starts by sorting pairs of ...
algorithm is a sorting algorithm whose time complexity is currently an open problem. The worst case complexity has an upper bound which can be given in terms of the Frobenius number of a given sequence of positive integers.


Least Live Weight Problem

Petri nets A Petri net, also known as a place/transition (PT) net, is one of several mathematical modeling languages for the description of distributed systems. It is a class of discrete event dynamic system. A Petri net is a directed bipartite graph that ...
are useful for modeling problems in
distributed computing A distributed system is a system whose components are located on different networked computers, which communicate and coordinate their actions by passing messages to one another from any system. Distributed computing is a field of computer sci ...
. For specific kinds of Petri nets, namely conservative weighted circuits, one would like to know what possible "states" or "markings" with a given weight are "live." The problem of determining the least live weight is equivalent to the Frobenius problem.


Terms in Expanded Power of a Polynomial

When a univariate polynomial is raised to some power, one may treat the exponents of the polynomial as a set of integers. The expanded polynomial will contain powers of x greater than the Frobenius number for some exponent (when GCD=1), e.g. for (1 + x^6 + x^7)^n the set is ' which has a Frobenius number of 29, so a term with x^ will never appear for any value of n but some value of n will give terms having any power of x greater than 29. When the GCD of the exponents is not 1 then powers larger than some value will only appear if they are a multiple of the GCD, e.g. for (1+x^9+x^)^n, powers of 24, 27, ... will appear for some value(s) of n but never values larger than 24 that are not multiples of 3 (nor the smaller values, 1-8, 10-14, 16, 17, 19-23).


See also

* Postage stamp problem * Change-making problem * Sylver coinage *
Numerical semigroup In mathematics, a numerical semigroup is a special kind of a semigroup. Its underlying set is the set of all nonnegative integers except a finite number and the binary operation is the operation of addition of integers. Also, the integer 0 must b ...


References

{{reflist, colwidth=30em


External links


How to order 43 Chicken McNuggets – Numberphile
Diophantine equations Recreational mathematics